/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "proveedores", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Proveedores.findAll", query = "SELECT p FROM Proveedores p"),
    @NamedQuery(name = "Proveedores.findByIdproveedores", query = "SELECT p FROM Proveedores p WHERE p.idproveedores = :idproveedores"),
    @NamedQuery(name = "Proveedores.findByProNombre", query = "SELECT p FROM Proveedores p WHERE p.proNombre = :proNombre"),
    @NamedQuery(name = "Proveedores.findByProDireccion", query = "SELECT p FROM Proveedores p WHERE p.proDireccion = :proDireccion"),
    @NamedQuery(name = "Proveedores.findByProTelefono", query = "SELECT p FROM Proveedores p WHERE p.proTelefono = :proTelefono"),
    @NamedQuery(name = "Proveedores.findByProEmail", query = "SELECT p FROM Proveedores p WHERE p.proEmail = :proEmail")})
public class Proveedores implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "idproveedores", nullable = false)
    private Integer idproveedores;
    @Size(max = 50)
    @Column(name = "pro_nombre", length = 50)
    private String proNombre;
    @Size(max = 50)
    @Column(name = "pro_direccion", length = 50)
    private String proDireccion;
    @Column(name = "pro_telefono")
    private Integer proTelefono;
    @Size(max = 50)
    @Column(name = "pro_email", length = 50)
    private String proEmail;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "idproveedores")
    private Collection<OrdenCompraCab> ordenCompraCabCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "proveedores")
    private Collection<CompraCab> compraCabCollection;

    public Proveedores() {
    }

    public Proveedores(Integer idproveedores) {
        this.idproveedores = idproveedores;
    }

    public Integer getIdproveedores() {
        return idproveedores;
    }

    public void setIdproveedores(Integer idproveedores) {
        this.idproveedores = idproveedores;
    }

    public String getProNombre() {
        return proNombre;
    }

    public void setProNombre(String proNombre) {
        this.proNombre = proNombre;
    }

    public String getProDireccion() {
        return proDireccion;
    }

    public void setProDireccion(String proDireccion) {
        this.proDireccion = proDireccion;
    }

    public Integer getProTelefono() {
        return proTelefono;
    }

    public void setProTelefono(Integer proTelefono) {
        this.proTelefono = proTelefono;
    }

    public String getProEmail() {
        return proEmail;
    }

    public void setProEmail(String proEmail) {
        this.proEmail = proEmail;
    }

    @XmlTransient
    public Collection<OrdenCompraCab> getOrdenCompraCabCollection() {
        return ordenCompraCabCollection;
    }

    public void setOrdenCompraCabCollection(Collection<OrdenCompraCab> ordenCompraCabCollection) {
        this.ordenCompraCabCollection = ordenCompraCabCollection;
    }

    @XmlTransient
    public Collection<CompraCab> getCompraCabCollection() {
        return compraCabCollection;
    }

    public void setCompraCabCollection(Collection<CompraCab> compraCabCollection) {
        this.compraCabCollection = compraCabCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idproveedores != null ? idproveedores.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Proveedores)) {
            return false;
        }
        Proveedores other = (Proveedores) object;
        if ((this.idproveedores == null && other.idproveedores != null) || (this.idproveedores != null && !this.idproveedores.equals(other.idproveedores))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Proveedores[ idproveedores=" + idproveedores + " ]";
    }
    
}
